package com.atm.bulksms.data;

import java.util.Vector;

public class ContactItem {

	private String name;
	private Vector<String> numberList;
	int id;
	
	
	public ContactItem(int id, String name, String number) {
		this.id = id;
		this.name = name;
		numberList = new Vector<String>();
		numberList.add(number);
	}
	public ContactItem(String name, Vector<String> numbers) {
		this.name = name;
		numberList = numbers;
	}
	
	public void addNumber(String number){
		numberList.add(number);
	}


	public void setName(String name) {
		this.name = name;
	}


	public String getName() {
		return name;
	}


	public void setNumberList(Vector<String> numberList) {
		this.numberList = numberList;
	}


	public Vector<String> getNumberList() {
		return numberList;
	}
	
	@Override
	public String toString() {
		// TODO Auto-generated method stub
		return name+numberList+",";
	}
	
	public boolean hasContact(String number){
		return numberList.contains(number);
	}
	
	/**
	 * @return the id
	 */
	public int getId() {
		return id;
	}
	/**
	 * @param id the id to set
	 */
	public void setId(int id) {
		this.id = id;
	}
	public String getNumberDetails() {
		StringBuffer buf = new StringBuffer();
		for (int i = 0; i < numberList.size(); i++) {
			buf.append(numberList.elementAt(i)).append(",");
		}
		return buf.toString();
	}
}
